class SceneManager {
	public constructor() {
	}

	private static _manager:SceneManager;
	public static getInstance(){
		if(!SceneManager._manager){
			SceneManager._manager = new SceneManager();
		}
		return SceneManager._manager;
	}

	private _currentScene:Scene;
	public gameStage:egret.DisplayObjectContainer;
	public changeScene(newScene:Scene){
		if(this._currentScene){
			this.gameStage.removeChild(this._currentScene);
			this._currentScene = null;
		}
		this.gameStage.addChild(newScene);
		this._currentScene = newScene;
	}
	//创建pop设置层
	private _pop:Scene;
	public pushScene(s:Scene){
		if(this._pop){
			return;
		}
		this.gameStage.addChild(s);
		
		this._pop = s;
	}
	public popScene(){
		if(this._pop){
			this.gameStage.removeChild(this._pop);
			this._pop = null;
		}
		
	}
}